package
{
	import com.senocular.display.TransformTool;
	
	import common.core.Core;
	import common.core.GEngine;
	import common.manager.GScene;
	import common.manager.Resource;
	
	import flash.display.Bitmap;
	import flash.display.SimpleButton;
	import flash.display.Sprite;
	import flash.display.Stage;
	import flash.events.Event;
	import flash.events.MouseEvent;
	
	import logic.cmd.InitCMD;
	import logic.def.UIURL;
	import logic.manager.XMLManager;
	import logic.scene.UIEditScene;
	import logic.ui.cell.ScanComponent_LstCell;

	[SWF(width=1200,height=700,backgroundColor=0x339900)]
	public class UIE extends Sprite
	{	
		public function UIE()
		{
			Resource.add("UISkin","assets/mc/ui/UISkin.swf");
			Resource.add("SkinRef","assets/xml/SkinRef.xml");
			
			var uiXMLLst : Array = ["UIFrame","Button","CheckBox","ComboBox","DataGrid","Label","List","TextArea","TextInput","UILoader","Image"];
			
			for(var i:int=0;i<uiXMLLst.length;i++)
			{
				var id:String = uiXMLLst[i];
				
				Resource.add(id,UIURL[id]);
			}
			
			Resource.start(null,loadComplete);
		}
		
		private function loadComplete(evt : Event) : void
		{
			Resource.stop(null,loadComplete);
			
			init();
		}
		
		private function init() : void
		{
			XMLManager.prase();
			
			GEngine.start(1200,700,this);
			
			new InitCMD;
			
			GScene.addScene(UIEditScene.NAME,new UIEditScene);
			
			GScene.openScene(UIEditScene.NAME);
			
		}
	}
}